package frc3128;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Watchdog;
import frc3128.Util.Constants;
import frc3128.Util.DebugLog;

/* 
 * THIS FILE SHOULD NOT BE MODIFIED
 * --------------------------------
 * It serves as a link to the Global class
 * Events triggered here will be forwarded to the Global class
 * This will also invoke the EventManager's sequencing. 
 * 
 * Do not call these functions under any circumstances. Do not modify this 
 * class under any circumstances.
 * 
 * AUTOGENERATED. DO NOT EDIT UNDER PENALTY OF 42.
 * 
 * THIS FILE IS YOUR SOUL.
 */

/**
 * 
 * @author Noah Sutton-Smolin
 */
public class RobotStartup extends IterativeRobot {
    public void robotInit() {
        DebugLog.setLogLevel(Constants.DEBUGLOG_DEFAULT_LOGLEVEL);
        Global.initializeRobot();
    }

    public void disabledInit() {Global.initializeDisabled();}

    // ARE YOU CHANGING THINGS?
    
    boolean autonomousHasBeenInit = false;
    public void autonomousInit() {
        if(!autonomousHasBeenInit) {
            Global.initializeAuto(); 
            autonomousHasBeenInit = true; 
            teleopHasBeenInit = false;
        }
    }
    
    // TURN BACK NOW.
    // YOUR CHANGES ARE NOT WANTED HERE.
    
    boolean teleopHasBeenInit = false;
    public void teleopInit() {
        if(!teleopHasBeenInit) {
            Global.initializeTeleop(); 
            teleopHasBeenInit = true; 
            autonomousHasBeenInit = false;
        }
    }
    
    public void disabledPeriodic() {        
        Watchdog.getInstance().feed();
        //if(Constants.EVENT_PROCESS_WHILE_DISABLED) EventManager.processEvents();
    }

    // YOU'D BETTER NOT CHANGE ANYTHING
    
    public void autonomousPeriodic() {
        Watchdog.getInstance().feed();
        //EventManager.processEvents();
    }

    // THIS IS YOUR SOUL.
    
    public void teleopPeriodic() {
        Watchdog.getInstance().feed();
        //EventManager.processEvents();
    }
}